# Maintainer: Martell Malone <martellmalone@gmail.com>

pkgname=cygrunsrv
pkgver=1.61
pkgrel=1
pkgdesc="$pkgname is a windows services tool"
_realname=cygrunsrv
arch=('i686' 'x86_64')
url="http://cygwin.org/"
license=('GPL')
depends=('python2')
makedepends=(gcc cvs)
source=(#"http://cygwin.cybermirror.org/release/$_realname/$_realname-$pkgver-1-src.tar.xz"
        #"$_realname-$pkgver"::"cvs+:pserver:anoncvs@sourceware.org:/cvs/cygwin-apps#branch=rel${pkgver/\./-}"
        $_realname-$pkgver.tar.bz2
        msysize.patch)
md5sums=('038e2c7520d9df6a34c87db9095928e3'
         '083ce932ae4bca70d47abc22b66ec81b')

prepare(){
  #cd $srcdir
  #tar xvjf $_realname-$pkgver.tar.bz2
  cd $_realname
  patch -p1 -i ${srcdir}/msysize.patch

  autoreconf -fi
}

build() {

  mkdir -p "${srcdir}/build-${CHOST}"
  cd "${srcdir}/build-${CHOST}"

  ../$_realname/configure \
    --prefix=/usr \
    --build=${CHOST} \
    --host=${CHOST} \
    --target=${CHOST}

  make
}

package() {
  cd "${srcdir}/build-${CHOST}"
  make DESTDIR="$pkgdir" install
}
